﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace Clinica_Frba.AbmdeRol
{
    public partial class Listado : Form
    {
        public Listado()
        {
            InitializeComponent();
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            { radioButton2.Checked = false;
            radioButton3.Checked = false;
            }
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton2.Checked)
            { radioButton1.Checked = false;
            radioButton3.Checked = false;
            }
        }

        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton3.Checked)
            {
                radioButton1.Checked = false;
                radioButton2.Checked = false;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string comando;
            comando = "";
            if (radioButton1.Checked) { comando = "SELECT * FROM DUNDER_MIFFLIN.ROL WHERE ESTADO='H'"; }
            if (radioButton2.Checked) { comando = "SELECT * FROM DUNDER_MIFFLIN.ROL WHERE ESTADO='I'"; }
            if (radioButton3.Checked) { comando = "SELECT * FROM DUNDER_MIFFLIN.ROL"; }
            SqlConnection myConnection = new SqlConnection(publico.ConnectionString);
            myConnection.Open();
            SqlDataAdapter da = new SqlDataAdapter(comando, myConnection);
            DataTable dt = new DataTable();
            da.Fill(dt);
            dataGridView1.DataSource = dt;
        }

        private void Listado_Load(object sender, EventArgs e)
        {

        }
    }
}
